3.2461 \(\int (a+b x^n)^2 \, dx\)

Optimal. Leaf size=38 \[ a^2 x+\frac {2 a b x^{n+1}}{n+1}+\frac {b^2 x^{2 n+1}}{2 n+1} \]

[Out]

a^2*x+2*a*b*x^(1+n)/(1+n)+b^2*x^(1+2*n)/(1+2*n)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {244} \[ a^2 x+\frac {2 a b x^{n+1}}{n+1}+\frac {b^2 x^{2 n+1}}{2 n+1} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x^n)^2,x]

[Out]

a^2*x + (2*a*b*x^(1 + n))/(1 + n) + (b^2*x^(1 + 2*n))/(1 + 2*n)

Rule 244

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n)^p, x], x] /; FreeQ[{a, b, n},
x] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int \left (a+b x^n\right )^2 \, dx &=\int \left (a^2+2 a b x^n+b^2 x^{2 n}\right ) \, dx\\ &=a^2 x+\frac {2 a b x^{1+n}}{1+n}+\frac {b^2 x^{1+2 n}}{1+2 n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 34, normalized size = 0.89 \[ x \left (a^2+\frac {2 a b x^n}{n+1}+\frac {b^2 x^{2 n}}{2 n+1}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^n)^2,x]

[Out]

x*(a^2 + (2*a*b*x^n)/(1 + n) + (b^2*x^(2*n))/(1 + 2*n))

________________________________________________________________________________________

fricas [A]  time = 1.04, size = 65, normalized size = 1.71 \[ \frac {{\left (b^{2} n + b^{2}\right )} x x^{2 \, n} + 2 \, {\left (2 \, a b n + a b\right )} x x^{n} + {\left (2 \, a^{2} n^{2} + 3 \, a^{2} n + a^{2}\right )} x}{2 \, n^{2} + 3 \, n + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)^2,x, algorithm="fricas")

[Out]

((b^2*n + b^2)*x*x^(2*n) + 2*(2*a*b*n + a*b)*x*x^n + (2*a^2*n^2 + 3*a^2*n + a^2)*x)/(2*n^2 + 3*n + 1)

________________________________________________________________________________________

giac [A]  time = 0.17, size = 73, normalized size = 1.92 \[ \frac {2 \, a^{2} n^{2} x + b^{2} n x x^{2 \, n} + 4 \, a b n x x^{n} + 3 \, a^{2} n x + b^{2} x x^{2 \, n} + 2 \, a b x x^{n} + a^{2} x}{2 \, n^{2} + 3 \, n + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)^2,x, algorithm="giac")

[Out]

(2*a^2*n^2*x + b^2*n*x*x^(2*n) + 4*a*b*n*x*x^n + 3*a^2*n*x + b^2*x*x^(2*n) + 2*a*b*x*x^n + a^2*x)/(2*n^2 + 3*n
 + 1)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 41, normalized size = 1.08 \[ \frac {2 a b x \,{\mathrm e}^{n \ln \relax (x )}}{n +1}+\frac {b^{2} x \,{\mathrm e}^{2 n \ln \relax (x )}}{2 n +1}+a^{2} x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*x^n)^2,x)

[Out]

a^2*x+b^2/(1+2*n)*x*exp(n*ln(x))^2+2*a*b/(n+1)*x*exp(n*ln(x))

________________________________________________________________________________________

maxima [A]  time = 0.49, size = 38, normalized size = 1.00 \[ a^{2} x + \frac {b^{2} x^{2 \, n + 1}}{2 \, n + 1} + \frac {2 \, a b x^{n + 1}}{n + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)^2,x, algorithm="maxima")

[Out]

a^2*x + b^2*x^(2*n + 1)/(2*n + 1) + 2*a*b*x^(n + 1)/(n + 1)

________________________________________________________________________________________

mupad [B]  time = 1.18, size = 36, normalized size = 0.95 \[ a^2\,x+\frac {b^2\,x\,x^{2\,n}}{2\,n+1}+\frac {2\,a\,b\,x\,x^n}{n+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x^n)^2,x)

[Out]

a^2*x + (b^2*x*x^(2*n))/(2*n + 1) + (2*a*b*x*x^n)/(n + 1)

________________________________________________________________________________________

sympy [A]  time = 0.47, size = 182, normalized size = 4.79 \[ \begin {cases} a^{2} x + 2 a b \log {\relax (x )} - \frac {b^{2}}{x} & \text {for}\: n = -1 \\a^{2} x + 4 a b \sqrt {x} + b^{2} \log {\relax (x )} & \text {for}\: n = - \frac {1}{2} \\\frac {2 a^{2} n^{2} x}{2 n^{2} + 3 n + 1} + \frac {3 a^{2} n x}{2 n^{2} + 3 n + 1} + \frac {a^{2} x}{2 n^{2} + 3 n + 1} + \frac {4 a b n x x^{n}}{2 n^{2} + 3 n + 1} + \frac {2 a b x x^{n}}{2 n^{2} + 3 n + 1} + \frac {b^{2} n x x^{2 n}}{2 n^{2} + 3 n + 1} + \frac {b^{2} x x^{2 n}}{2 n^{2} + 3 n + 1} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x**n)**2,x)

[Out]

Piecewise((a**2*x + 2*a*b*log(x) - b**2/x, Eq(n, -1)), (a**2*x + 4*a*b*sqrt(x) + b**2*log(x), Eq(n, -1/2)), (2
*a**2*n**2*x/(2*n**2 + 3*n + 1) + 3*a**2*n*x/(2*n**2 + 3*n + 1) + a**2*x/(2*n**2 + 3*n + 1) + 4*a*b*n*x*x**n/(
2*n**2 + 3*n + 1) + 2*a*b*x*x**n/(2*n**2 + 3*n + 1) + b**2*n*x*x**(2*n)/(2*n**2 + 3*n + 1) + b**2*x*x**(2*n)/(
2*n**2 + 3*n + 1), True))

________________________________________________________________________________________